package com.rss.inbound.processor;

import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration;
/*import org.hibernate.service.ServiceRegistry;
import org.hibernate.service.ServiceRegistryBuilder;*/

/*import com.rss.inbound.beans.RSSEntry;
import com.rss.inbound.beans.RSS_Source;
import com.rss.inbound.beans.Status;*/

public class HibernateUtil {
	private static SessionFactory sessionFactory;
//	private static ServiceRegistry serviceRegistry;

	static {
		try {
/*			Configuration configuration = new Configuration();
			configuration.addAnnotatedClass(RSS_Source.class);
			configuration.addAnnotatedClass(Status.class);
			configuration.addAnnotatedClass(RSSEntry.class);*/
/*			
		    configuration.configure("hibernate.cfg.xml");
		    
		    serviceRegistry = new ServiceRegistryBuilder().applySettings(configuration.getProperties()).buildServiceRegistry();        
		    sessionFactory = configuration.buildSessionFactory(serviceRegistry);
		    //return sessionFactory;
*/		    
		} catch (Throwable ex) {
			System.err.println("Initial SessionFactory creation failed." + ex);
			throw new ExceptionInInitializerError(ex);
		}
	}

	public static SessionFactory getSessionFactory() {
		return sessionFactory;
	}
}
